package com.lifeng.patterns.singleton;

/**
 * Created by lifeng on 2019/9/11.
 */
public class SingleOne {
    /**私有化构造方法*/
    private SingleOne(){}
    /**类加载就实例化,私有静态引用指向自己实例 */
    private static SingleOne instance = new SingleOne();
    /**以自己实例为返回值的公有静态方法*/
    public static SingleOne getInstance(){
        return instance;
    }
}
